Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the input param of fusion op interface from pointer to tensor #36349

Merged
merged 5 commits into from
Oct 12, 2021

Conversation

ZzSean
Copy link
Contributor

@ZzSean ZzSean commented Oct 11, 2021

PR types

Others

PR changes

OPs

Describe

将 cudnn_norm_conv、cudnn_bn_stats_finalize 与 cudnn_scale_bias_add_relu 三个融合op的接口参数,由指针改为tensor,相应的修改了对应的单测。

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

paddle/fluid/operators/fused/cudnn_bn_stats_finalize.cu.h Outdated Show resolved Hide resolved
paddle/fluid/operators/fused/cudnn_bn_stats_finalize.cu.h Outdated Show resolved Hide resolved
paddle/fluid/operators/fused/cudnn_norm_conv.cu.h Outdated Show resolved Hide resolved
paddle/fluid/operators/fused/cudnn_norm_conv.cu.h Outdated Show resolved Hide resolved
paddle/fluid/operators/fused/cudnn_norm_conv.cu.h Outdated Show resolved Hide resolved
paddle/fluid/operators/fused/cudnn_norm_conv.cu.h Outdated Show resolved Hide resolved
python/paddle/nn/functional/__init__.py Outdated Show resolved Hide resolved
Copy link
Contributor

@Xreki Xreki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

ASSERT_THROW(test.CheckBackward(1e-3), paddle::platform::EnforceNotMet);
} else {
ASSERT_NO_THROW(test.CheckForward(1e-3, true));
ASSERT_NO_THROW(test.CheckBackward(1e-3));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里其实没有必要加ASSERT_NO_THROW

T *z_bias_ptr = nullptr) {
void Forward(const platform::CUDADeviceContext &ctx, const Tensor &x,
const Tensor &x_scale, const Tensor &x_bias, const Tensor &z,
const Tensor &z_scale, const Tensor &z_bias, Tensor *out,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

z可能并不存在,这种情况如何调用,也需要定义个空的Tensor?

@ZzSean ZzSean changed the title Change the input param of fusion op inference from pointer to tensor Change the input param of fusion op interface from pointer to tensor Oct 12, 2021
@Xreki Xreki merged commit 3e2dec5 into PaddlePaddle:develop Oct 12, 2021
@ZzSean ZzSean deleted the cudnn_fusion_op branch October 15, 2021 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants